import { Form, Root, Textarea } from 'native-base';
import React from 'react';
import { ScrollView, Text, TextInput, TouchableOpacity, View } from 'react-native';


// interface Subject {
// 	subject_num: string;
// 	subject_name: string;
// }
// interface Classes {
// 	class_id: string;
// 	class_name: string;
// }
export default function tpl(a: <T>(action: string, ...args: unknown[]) => ((...args: unknown[]) => void), s: (...class_names: string[]) => {}, d: (d: string) => string | unknown[]) {
	const subject = d('subject') as string;
	const classes = d('classes') as string;
	const zyname = d('zyname') as string;
	const zynr = d('zynr') as string;
	return (
		<View style={{ height: '100%', flexDirection: 'column', justifyContent: 'space-between' }}>
			<Root>
				<ScrollView>
					<View style={s('view1')}>
						<Text style={s('xs')}><Text style={{ color: 'red' }}>*</Text>作业名称：</Text>
						<TextInput style={s('input')} onChangeText={a('a004')} value={zyname} />
					</View>
					<View style={s('view2')}>
						<Form>
							<Textarea rowSpan={5} placeholder="请输入作业内容" onChangeText={a('a005')} value={zynr} />
						</Form>
					</View>
					<View style={s('view3')}>
						<TouchableOpacity style={s('tz5')} onPress={a('a002')}>
							<Text style={s('ztext')}>
								<Text style={s('zt')}>班级：</Text>
								<Text style={s('zt')}>{classes || '选择班级'}</Text>
							</Text>
						</TouchableOpacity>
						<TouchableOpacity style={s('tz5')} onPress={a('a003')}>
							<Text style={s('ltext')}>
								<Text style={s('zt')}>科目：</Text>
								<Text style={s('zt')}>{subject || '选择科目'}</Text>
							</Text>
						</TouchableOpacity>
					</View>
				</ScrollView>
				<Form>
					<View style={s('zd')}>
						<TouchableOpacity style={s('tz5')} onPress={a('a006')}>
							<Text style={s('text1')}>发布</Text>
						</TouchableOpacity>
						<TouchableOpacity style={s('tz5')} onPress={a('a007')}>
							<Text style={s('text2')}>取消</Text>
						</TouchableOpacity>
					</View>
				</Form>
			</Root>
		</View>
	);
}
